home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / human interface toolbox / handyscrollingsample / sampleutils.h < prev   
Encoding:
C/C++ Source or Header  |  2000-06-23  |  5.4 KB  |  116 lines

  1. /*
  2.     File: SampleUtils.h
  3.     
  4.     Description:
  5.         This file contains routine prototypes that can be used to access
  6.     routines defined in SampleUtils.c.  These routines have been moved
  7.     here to a separate file to simplify the example.
  8.  
  9.     Copyright:
  10.         © Copyright 2000 Apple Computer, Inc. All rights reserved.
  11.     
  12.     Disclaimer:
  13.         IMPORTANT:  This Apple software is supplied to you by Apple Computer, Inc.
  14.         ("Apple") in consideration of your agreement to the following terms, and your
  15.         use, installation, modification or redistribution of this Apple software
  16.         constitutes acceptance of these terms.  If you do not agree with these terms,
  17.         please do not use, install, modify or redistribute this Apple software.
  18.  
  19.         In consideration of your agreement to abide by the following terms, and subject
  20.         to these terms, Apple grants you a personal, non-exclusive license, under Apple’s
  21.         copyrights in this original Apple software (the "Apple Software"), to use,
  22.         reproduce, modify and redistribute the Apple Software, with or without
  23.         modifications, in source and/or binary forms; provided that if you redistribute
  24.         the Apple Software in its entirety and without modifications, you must retain
  25.         this notice and the following text and disclaimers in all such redistributions of
  26.         the Apple Software.  Neither the name, trademarks, service marks or logos of
  27.         Apple Computer, Inc. may be used to endorse or promote products derived from the
  28.         Apple Software without specific prior written permission from Apple.  Except as
  29.         expressly stated in this notice, no other rights or licenses, express or implied,
  30.         are granted by Apple herein, including but not limited to any patent rights that
  31.         may be infringed by your derivative works or by other works in which the Apple
  32.         Software may be incorporated.
  33.  
  34.         The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
  35.         WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
  36.         WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  37.         PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
  38.         COMBINATION WITH YOUR PRODUCTS.
  39.  
  40.         IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
  41.         CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  42.         GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  43.         ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
  44.         OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
  45.         (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
  46.         ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  47.  
  48.     Change History (most recent first):
  49.         Tue, Feb 8, 2000 -- created
  50. */
  51.  
  52.  
  53.  
  54. #ifndef __SAMPLEUTILS__
  55. #define __SAMPLEUTILS__
  56.  
  57. #define TARGET_API_MAC_CARBON 1
  58.  
  59. #include <Types.h>
  60. #include <Windows.h>
  61. #include <Controls.h>
  62.  
  63. /* version number for the SampleUtils.h / SampleUtils.c set of files. */
  64. #define SAMPLEUTILSVERSION "Sample Utils 2000, Version 1.0.0"
  65.  
  66. /* GetApplicationFolder returns the volume reference number and
  67.     directory id of the folder containing the application. */
  68. OSStatus GetApplicationFolder(FSSpec *spec);
  69.  
  70.  
  71. /* DrawGrowIconWithoutScrollLines draws the grow icon in the bottom
  72.     right corner of the frontmost window without drawing the scroll bar
  73.     lines.  It does this by setting the clip region to the bottom right corner
  74.     before calling DrawGrowIcon. */
  75. void DrawGrowIconWithoutScrollLines(WindowPtr window);
  76.  
  77.  
  78. /* SetWindowStandardStateSize sets the window's standard state rectangle
  79.     to a rectangle of the size suggested in the width and height parameters.
  80.     In the end, it may set the standard size to something smaller than the
  81.     width and height parameters so the entire window remains visible.  The
  82.     standard rectangle is also centered on the main screen.  The window's
  83.     standard state rectangle is used by ZoomWindow whenever when it
  84.     is called with the inZoomOut partcode. */
  85. void SetWindowStandardStateSize(WindowPtr window, short width, short height);
  86.  
  87. /* GrayOutBox grays out an area of the screen in the current grafport.  
  88.     *theBox is in local coordinates in the current grafport. This routine
  89.     is for direct screen drawing only.  */
  90. void GrayOutBox(Rect *theBox);
  91.  
  92.  
  93. /* RgnUnionRect adds the rectangle into the region. This routine works
  94.     by creating a temporary rectangular region equivalent to srcRect
  95.     and then calling UnionRgn. It's purpose is simply to stand in as a
  96.     shorthand for that sequence of calls.  */
  97. void RgnUnionRect(RgnHandle theRegion, Rect* srcRect);
  98.  
  99.  
  100. /* SetScrollBarCursor sets the cursor according to the mouse position
  101.     over a scroll bar.  If the cursor is over the scroll bar, then the routine
  102.     will return true and it will set the region mouseRgn to a region where
  103.     the mouse should remain as it has been set.  This region will be in global
  104.     coordinates suitable for passing to WaitNextEvent in the mouse region
  105.     parameter. */
  106. Boolean SetScrollBarCursor(ControlHandle scrollBar, Point where, RgnHandle mouseRgn);
  107.  
  108.  
  109. /* GetMenuBarRegion sets the region mBarRgn to the global coordinates
  110.     of the menu bar.  This region is useful for passing to WaitNextEvent
  111.     in the mouse region parameter after you have set the mouse to a special
  112.     cursor for the menu bar area.  */
  113. void GetMenuBarRegion(RgnHandle mBarRgn);
  114.  
  115. #endif
  116.